package tamz2.fuellog;

import java.util.List;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

public class fuellog extends Activity {
	
	private Database db;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    
        this.db = new Database(this);
        this.db.deleteAll();
               
        EditText ed1 = (EditText)findViewById(R.id.EditText01);
        ed1.setText(this.db.getFirst());
    
    }
    
    public void button_click(View v) {
    	
    	EditText ed1 = (EditText)findViewById(R.id.EditText01);
    	
    	if (v == findViewById(R.id.button1)) {
    		ed1.setText(this.db.getPrev());
    	}
    	if (v == findViewById(R.id.button2)) {
    		ed1.setText(this.db.getNext());
    	}
    		
    	
    	
    	
    }
    
    
}